// electron/handler/SystemHandlers.ts
import { ipcMain } from 'electron';
import SystemController from '../controller/SystemController';
import log from 'electron-log/main';

export function setupSystemHandlers() {
  ipcMain.handle('fetch-data', async (_event, url: string) => {
    return await SystemController.getDataFromUrl(url);
  });

  return () => {
    ipcMain.removeHandler('fetch-data');
    log.info('IPC 处理器已清理');
  };
}
